Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Analytics Engine #691

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cmackenzie1
Copy link

@cmackenzie1 cmackenzie1 commented Jan 7, 2025

This one was a little tricky to add and requires mocking out the analytics engine binding using a miniflare wrapped binding that logs each data point to console.

Closes #280
Closes #327

@cmackenzie1 cmackenzie1 force-pushed the cole/analytics-engine branch 3 times, most recently from b00fc22 to 1a8a7d5 Compare January 9, 2025 18:07
This one was a little tricky to add and requires mocking out the
analytics engine binding using a miniflare wrapped binding that logs
each datapoint to console.

Resolves cloudflare#280, cloudflare#327

refactor: rename to match Typescript type names

test: mock out analytics engine binding
@cmackenzie1 cmackenzie1 force-pushed the cole/analytics-engine branch from 1a8a7d5 to 9f24b41 Compare January 9, 2025 18:12
@cmackenzie1 cmackenzie1 marked this pull request as ready for review January 9, 2025 18:12
@cmackenzie1 cmackenzie1 changed the title WIP: Add support for Analytics Engine Add support for Analytics Engine Jan 9, 2025
.github/workflows/pullrequest.yml Outdated Show resolved Hide resolved
worker/src/analytics_engine.rs Outdated Show resolved Hide resolved
worker/src/analytics_engine.rs Outdated Show resolved Hide resolved
worker/src/analytics_engine.rs Outdated Show resolved Hide resolved
worker/src/analytics_engine.rs Outdated Show resolved Hide resolved
worker/src/analytics_engine.rs Show resolved Hide resolved
worker/src/analytics_engine.rs Outdated Show resolved Hide resolved
@cmackenzie1 cmackenzie1 force-pushed the cole/analytics-engine branch from 5d60161 to 9a09313 Compare January 10, 2025 05:09
@cmackenzie1
Copy link
Author

@zebp since the type is Array<bytes | string> I simplified the types to use an enum instead, removing all the generic parameters. Added the convenience function write_to as well as doubles, blobs which set the entire array and then add_blob and add_double which append to the current array of values.

Changes some of the API to be more flexible and remove the temporary
`Vec` usage by using `Array` directly.
@cmackenzie1 cmackenzie1 force-pushed the cole/analytics-engine branch from 9a09313 to 1f552a9 Compare January 10, 2025 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Workers Analytics Engine [Feature] Workers Analytics Engine Support
2 participants